package io.renren.modules.quickService.constants;

import java.util.HashMap;
import java.util.Map;

public enum UserExtraEnum {

    TO_AUDIT("TO_AUDIT","审核中"),
    VERIFIED("VERIFIED","通过审核"),
    AUDIT_FAILED("AUDIT_FAILED","未通过审核");

    private final String key;
    private final String value;

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    UserExtraEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String getValueByKey(String key) {
        UserExtraEnum[] enums = UserExtraEnum.values();
        for (int i = 0; i < enums.length; i++) {
            if (enums[i].getKey().equals(key)) {
                return enums[i].getValue();
            }
        }
        return "";
    }


    /**
     * 转换为MAP集合	 * 	 * @returnMap<String, String>
     */
    public static Map<String, String> toMap() {
        Map<String, String> map = new HashMap<String, String>();
        UserExtraEnum[] enums = UserExtraEnum.values();
        for (int i = 0; i < enums.length; i++) {
            map.put(enums[i].getKey().toString(), enums[i].getValue());
        }
        return map;
    }


}
